package search;




public class Replace{
	public static String replace(String strSource,String strFrom,String strTo)   
	{
	   if(strFrom == null || strFrom.equals(""))   
	   	return   strSource;   
	   String strDest = ""; 
	   int intFromLen = strFrom.length();
	   int intPos;
	
	   while((intPos=strSource.indexOf(strFrom))!=-1)
	   {   
	    	strDest = strDest + strSource.substring(0,intPos);
	         strDest = strDest + strTo;
		strSource =strSource.substring(intPos + intFromLen);
	   }   
	   strDest = strDest + strSource;
	   return strDest;
	}

}